package com.catazy.wanandroid.module_login.service

import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.catazy.wanandroid.common_base.constants.Constants
import com.catazy.wanandroid.common_base.constants.RouterPath
import com.catazy.wanandroid.common_service.login.LoginOutService
import com.catazy.wanandroid.module_login.repository.RegisterLoginLocalRepository
import com.catazy.wanandroid.module_login.repository.RegisterLoginRemoteRepository
import com.catazy.wanandroid.module_login.repository.RegisterLoginRepository
import com.catazy.wanandroid.module_login.viewmodel.RegisterLoginViewModel
import kotlinx.coroutines.flow.Flow

/**
 * 作者: Tao
 * 日期: 2024/4/17
 * 时间: 9:56
 * 描述:
 */
@Route(path = RouterPath.LoginRegister.SERVICE_LOGOUT)
class LoginOutServiceImpl : LoginOutService {
    override suspend fun logOut(): Flow<String> {
        val viewModel = RegisterLoginViewModel(
            RegisterLoginRepository.getInstance(
                RegisterLoginRemoteRepository.instance,
                RegisterLoginLocalRepository.instance
            )
        )
        return viewModel.logOutToMain()
    }

    override fun init(p0: Context?) {
    }
}